#include <string>
#include <cstddef>
#include <cstdlib>
#include "random_string.hpp"

using namespace std;

namespace judge {

random_string::random_string(size_t size, const string &base)
	: string(_make_string(size, base))
{}

string random_string::_make_string(size_t size, const string &base)
{
	string result;
	for (size_t i = 0; i != size; ++i) {
		result.push_back(base[rand() % base.size()]);
	}
	return result;
}

}
